﻿//-----------------------------------------------------------------------
// <copyright file="IRuleDescriptor.cs">
//     Copyright (c) Nicole Calinoiu. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Diagnostics.CodeAnalysis;

using Microsoft.FxCop.Sdk;
using Microsoft.VisualStudio.CodeAnalysis.Extensibility;

namespace Bordecal.FxCop.Sdk
{
	/// <summary>
	/// Describes an FxCop rule.
	/// </summary>
	public interface IRuleDescriptor
	{
		#region Properties

		/// <summary>
		/// Gets the category under which the rule should appear in reports and the FxCop user interface.
		/// </summary>
		string Category { get; }

		/// <summary>
		/// Gets the certainty that a reported problem is an actual violation of the rule.
		/// </summary>
		int Certainty { get; }

		/// <summary>
		/// Gets the unique identifier for the rule.
		/// </summary>
		string CheckId { get; }

		/// <summary>
		/// Gets a description of the rule.
		/// </summary>
		string Description { get; }

		/// <summary>
		/// Gets the e-mail address to be used for support for the rule.
		/// </summary>
		string Email { get; }

		/// <summary>
		/// Gets the <see cref="FixCategories"/> for violations of the rule.
		/// </summary>
		FixCategories FixCategories { get; }

		/// <summary>
		/// Gets the <see cref="MessageLevel"/> for violations of the rule.
		/// </summary>
		MessageLevel MessageLevel { get; }

		/// <summary>
		/// Gets the name of the rule.
		/// </summary>
		string Name { get; }

		/// <summary>
		/// Gets the name of the rule owner.
		/// </summary>
		string Owner { get; }

		/// <summary>
		/// Gets the help URL for the rule.
		/// </summary>
		[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings",
			Justification = "IRule.Url uses a string, and there is a performance cost to converting back and forth between Uri and String.")]
		string Url { get; }

		#endregion

		#region Methods

		/// <summary>
		/// Returns the resolution pattern string for a specified resoution.
		/// </summary>
		/// <param name="name">The resolution pattern name.</param>
		/// <returns>The resolution pattern string.</returns>
		string GetResolutionText(string name);

		#endregion
	}
}